home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / misc / emu / PCDisk91b.lha / PCdisk.doc < prev   
Encoding:
Text File  |  1994-01-16  |  11.6 KB  |  262 lines

  1.  
  2.                  PCDISK V0.91 Beta -- freely distributable
  3.  
  4.                        by Eddy Carroll, January 1994
  5.  
  6.  
  7. INTRODUCTION
  8.  
  9.     PCDisk makes an entire hard disk partition appear as a single AmigaDOS
  10.     file to programs, allowing Janus to use that partition to create a
  11.     disk file for the Bridgeboard hard disk image. Since all file i/o
  12.     can go directly to the partition without having to go through the
  13.     standard AmigaDOS filesystem, performance is improved (particulary
  14.     for writes).
  15.  
  16.     If you are not comfortable with mountlists, partitions, etc. now is
  17.     the time to stop reading and delete PCDisk. I accept no responsibility
  18.     for any damage or loss of data it may cause. However, by way of
  19.     reassurance, myself and my beta testers have been running it for
  20.     over a year without any known problems.
  21.  
  22.  
  23. INSTALLATION
  24.  
  25.     This is a beta version, and so lacks a fancy Install utility with
  26.     GUI. To install, follow these steps:
  27.  
  28.     1. Use HDToolBox or equivalent to create a new partition for your
  29.        bridgeboard partition.
  30.  
  31.     2. After rebooting, run the included DiskInfo utility on that
  32.        partition and write down the Unit, Surfaces, BlocksPerTrack,
  33.        LowCyl and HighCyl values. (For example, type "DiskInfo DH2:".)
  34.  
  35.     3. Edit the included Mountlist and insert the above values at
  36.        the points indicated by ???, then append the whole thing
  37.        to DEVS:Mountlist. (See below for information about the
  38.        IBM: entry in the same mountlist.)
  39.  
  40.     4. Copy PCDisk-Handler into your L: directory
  41.  
  42.     5. MOUNT PCD: to activate the handler (you may like to add this to
  43.        your startup-sequence.)
  44.  
  45.     6. Edit the SYS:PC/SYSTEM/ABOOT.CTRL file, which points to the
  46.        disk file Janus uses for the PC hard disk. Change it to read
  47.        PCD:/AUTO/S32/H8. This will select a PC autoboot partition
  48.        which will appear to have 32 sectors per track and 8 heads.
  49.  
  50.     7. Startup the PC Bridgeboard and boot off an MS-DOS floppy. Run
  51.        FDISK to partition the drive and create a single partition at
  52.        the maximum size (several partitions might work; haven't tried
  53.        it.)
  54.  
  55.     8. After FDisk has done its stuff, format drive C: under MS-DOS
  56.        using the /S option to copy the system across. Install MS-DOS
  57.        itself. (If you're running DOS 5, it will handle all the
  58.        formatting etc. for you.)
  59.  
  60.     9. Now reboot and you should be in business. If you have files already
  61.        on your old PC partition that you want to copy across, read on.
  62.  
  63.  
  64. ACCESSING THE PARTITION ON THE AMIGA
  65.  
  66.     If you have CrossDos, you can mount the Bridgeboard partition under
  67.     AmigaDOS using the CrossDos filesystem, which will allow you to access
  68.     all your IBM files using standard CLI commands. Some tricky calculations
  69.     are needed to make this work, for now; eventually, it will be automated.
  70.  
  71.     Essentially, what's happening is this. PCDisk-Handler looks at the entire
  72.     Amiga disk drive as an IBM drive which is laid out as N cylinders with
  73.     8 heads and 32 sectors per track (for a total of 256 * N blocks of
  74.     storage). The drive as seen by the Amiga will have a geometry that
  75.     more closely matches the drives physical layout (e.g. 1 head, 256
  76.     sectors per track, or 9 heads, 40 sectors per track.) Using the start
  77.     and end cylinders on the Amiga disk, the number of COMPLETE IBM
  78.     cylinders that can fit into the same disk space is what PCDisk-handler
  79.     will make available to Janus.
  80.  
  81.     Now, to mount CrossDos, we need to work out by hand what this set
  82.     of overlapping cylinders works out as. So, use the following formula:
  83.  
  84.          H  = Number of Amiga Heads
  85.      S  = Number of Amiga sectors per track
  86.      LC = Amiga Low Cylinder
  87.      HC = Amiga High Cylinder
  88.  
  89.                       (LC * S * H) + (32 * 8 - 1)   
  90.         PCLowCyl   =  ---------------------------
  91.                            32 * 8              
  92.  
  93.                       LC * S * H + 255
  94.                    =  ----------------
  95.                             256
  96.  
  97.  
  98.                       ((HC + 1) * S * H) - 1 - (32 * 8 - 1)
  99.         PCHighCyl  =  -------------------------------------
  100.                                       32 * 8
  101.        
  102.                       (HC + 1) * S * H - 256
  103.                    =  ----------------------
  104.                                 256
  105.  
  106.  
  107.     When the two final equations are evaluated, throw away any fractions.
  108.     So now we have a value for LowCyl and HighCyl in the IBM: entry in
  109.     the mountlist. Or do we? Not quite... Janus includes a partition
  110.     table at the start of the PC partition (the same one used by FDISK
  111.     under MS-DOS) but CrossDos just wants a plain PC partition with no
  112.     such complications. Now, the partition table takes up exactly one
  113.     track (not cylinder) on the PC disk, so we need to tell CrossDos to
  114.     skip a single track.
  115.     
  116.     The only way to do this is to change the disk layout from having 32
  117.     sectors per track and 8 heads and N cylinders to one having 32 sectors
  118.     per track and 1 head and 8*N cylinders; we we can then skip past the
  119.     first cylinder (the one with the partition table) and give the rest
  120.     to CrossDos.
  121.  
  122.     So, do the following calculations:
  123.  
  124.         NewPCLowCyl    = PCLowCyl * 8 + 1
  125.  
  126.     NewPCHighCyl   = (PCHighCyl + 1) * 8 - 1
  127.  
  128.     Now, go back to the IBM: mountlist entry and put the above two values
  129.     into the LowCyl and HighCyl entries. Also ensure the Unit number is
  130.     set correctly (as originally reported via DiskInfo way back above) and
  131.     that the BlocksPerTrack and Surfaces are set to 32 and 1 respectively.
  132.     
  133.     Now, if all has gone according to plan, you should be able to
  134.     MOUNT IBM: and then DIR IBM: from a CLI to show the PC directory.
  135.     If DIR doesn't produce anything useful, then you have very likely
  136.     made a mistake in the above calculations; go back and check them.
  137.     If it still doesn't work, then maybe I've made a mistake, so let me
  138.     know.
  139.  
  140.     Regardless, you can't do any damage just by mounting an incorrectly
  141.     specified IBM:, so don't be too concerned. If everything appears to
  142.     be working, then you can copy files to it from AmigaDOS using the
  143.     Copy command. One word of caution: some versions of CrossDos seem
  144.     to have a problem creating directories on a PC partition that are
  145.     accessible from MS-DOS; you may be wise to create all directories
  146.     from MS-DOS itself just to be on the safe side.
  147.  
  148.     Important: Since the Bridgeboard and Amiga have no way of knowing
  149.     when the other has written to the IBM partition, you need to synchronise
  150.     access carefully. Always do a DISKCHANGE IBM: on the Amiga if you've
  151.     recently written to the drive on the Bridgeboard side. If you've just
  152.     copied files over from the Amiga, do a CHKDSK C: on the Bridgeboard
  153.     (or reboot) to bring its internal representation up to date.
  154.  
  155.     Now that this has been done, you are in a position to copy across files
  156.     from your original Janus disk partition. To do this, go back into
  157.     SYS:PC/SYSTEM/ABOOT.CTRL and change it to point back to the original
  158.     Janus disk file you were using (something like DH0:PCDRIVE/DRIVEC),
  159.     MOUNT IBM: and then start the BridgeBoard. Now, using AWRITE under MS-DOS,
  160.     you should be able to copy files to the new IBM partition by using:
  161.  
  162.         AWRITE *.* IBM: /S /B
  163.  
  164.     The /S handles sub-directories. If you are not running Janus 2.1, you
  165.     probably won't have wildcard facilities with WRITE, and in that case,
  166.     you have a much tougher job; you can either build a batch file to do
  167.     all the copying for you, or more simply, just back up your PC partition
  168.     to floppy and restore it to the new partition.
  169.  
  170.     Either way, when you've finished transferring the data, change the
  171.     SYS:PC/SYSTEM/ABOOT.CTRL file once more back to PCD:/AUTO/S32/H8 and
  172.     you should be finished!
  173.  
  174.  
  175. SWITCH OPTIONS
  176.  
  177.     You've probably noticed that PCD: seems to accept a CON: style
  178.     list of settings after the device name. Here's a full list of all
  179.     the switches recognised:
  180.  
  181.         /AUTO      Include a 512 byte autoboot header at start of file
  182.     /AMIGA     Read sector and head info from the Amiga partition
  183.     /IBM       Use IBM settings of 4 heads and 17 sectors (default)
  184.     /NEW       Only allow opening of "new" files (fail MODE_OLDFILE)
  185.     /Sx        Set PC partition to x sectors per track
  186.     /Hx        Set PC partition to x heads per cylinder
  187.  
  188.     The /AUTO switch is needed because Janus expects a 512 byte header
  189.     at the start of the file. It doesn't cause the header to appear
  190.     physically on the disk (which would confuse CrossDos and other
  191.     disk utilities), instead it magically makes it appear at the start
  192.     of the file when the disk is being accessed via PCD:.
  193.  
  194.     /NEW is needed if additional Janus psuedo-disks are being mounted,
  195.     also using PCD:. When you try to initialise a pseudo-disk under
  196.     Janus (using the Create option), it first checks to see if the file
  197.     already exists and fails if it does; the /NEW option allows this
  198.     to be worked around. After the disk has been initialised, the /NEW
  199.     suffix is dropped for normal access.
  200.  
  201.     I wouldn't recommend using Janus psuedo-disks (via the CONFIG.SYS
  202.     handler) at this time; it can be made to work correctly, but it is
  203.     messy and there is room for error. The main problem is that when
  204.     you tell Janus to create a 10 meg partition, it will actually
  205.     create anywhere between 9 and 12 megs, depending on what mood it is
  206.     in. If it's too small, that's not a serious problem, but if it's too
  207.     large, PCDisk-Handler will refuse to access the uppermost sectors on
  208.     the disk and Janus will report disk errors. Eventually, I'll write
  209.     a program to handle disk creation on the Amiga side which will solve
  210.     this problem.
  211.  
  212.     The /AMIGA option is handy if you already have a PC partition on your
  213.     Amiga disk, perhaps from the IBeM emulator or something similar, which
  214.     is laid out using Amiga head and sector values. As long as the number
  215.     of heads is <= 16 and the number of sectors per track is <= 62, you
  216.     should be able to use it unchanged (and even boot off it) by setting
  217.     SYS:PC/SYSTEM/ABOOT.CTRL to PCD:/AUTO/AMIGA.
  218.  
  219.  
  220. BUGS AND PROBLEMS
  221.  
  222.     The main bugs at the moment are Workbench 2.0 related. Programs such as
  223.     CShell V5.19 can access the device okay (e.g. htype PCD:/AUTO/S32/H8)
  224.     but Workbench 2.0 fails. I'm not quite sure why this is; it has
  225.     something to do with the MatchNext() AmigaDOS 2.0 call. I'd like to
  226.     get it working for completeness, but it's not necessary if the handler
  227.     is only being used with Janus.
  228.  
  229.  
  230. HISTORY
  231.  
  232.     July 92    Receive my new bridgeboard; appalled by speed of disk emulation.
  233.                Create PCDisk as a quick hack to fix it.
  234.  
  235.     July 93    Foolishly mention it in comp.sys.amiga.emulations and lots of
  236.                people ask for copies :-) Email them out privately.
  237.  
  238.     Jan 94     People start asking can it be uploaded to Aminet. I give up
  239.                my dream of ever having enough time to do a fancy 1.0 version
  240.                and decide to release it as is. I hope it proves useful!
  241.  
  242.  
  243. FREEWARE AD (hi Ralph :-)
  244.  
  245.     I didn't have "The Amiga Guru Book" by Ralph Babel when I originally
  246.     wrote this; if I had, any mistakes I've made would probably have been
  247.     avoided. If you do any Amiga system programming, you owe it to yourself
  248.     to buy this book. I got my copy from Hirsch & Wolf in Germany,
  249.     phone +49-2631-83990 or fax +49-2631-839931.
  250.  
  251.  
  252. CONTACT
  253.  
  254.     If you have questions or problems, you can contact me at:
  255.  
  256.         ecarroll@maths.tcd.ie
  257.  
  258.     This is valid as of 16 January 1994. At some stage in the future,
  259.     I'd like to add nice GUI install program that will work out your
  260.     existing setup, create mountlist entries for both PCD: and IBM:,
  261.     and other nice things. For now, good luck!
  262.